<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html debug="false">
<head>
<title>yui.js</title>

<script type="text/javascript" src="../../build/yuiloader/yuiloader-debug.js"></script>

<script type="text/javascript">


    function log(msg) {

        if (typeof console !== "undefined" && console.debug) {
            console.debug(msg);
        } else {
            //alert(msg);
            var d=document, b=d.body, n=d.createElement("div");
            if (b) {
                n.appendChild(d.createTextNode(msg));
                b.appendChild(n);
            }
        }
    }

                    var loader = new YAHOO.util.YUILoader()

                    loader.allowRollup = false;

                    loader.addModule({
                        name: "jsoncss",
                        type: "css",
                        fullpath: "http://www.json.org/json.css",
                        //requires: ["datatable", "skin-sam-datatable"]
                        //requires: ["skin-sam-datatable"],
                        // after: ["reset-fonts-grids", "reset", "fonts", "grids"],
                        after: ["reset-fonts-grids"],
                        requires: ["reset-fonts-grids"]
                    });

                    loader.addModule({
                        name: "json",
                        type: "js",
                        fullpath: "http://www.json.org/json.js",
                        requires: ["jsoncss"]
                        //skinnable: true
                    });

                    // loader.require("tabview", "treeview", "json","reset-fonts-grids", "datatable");
                    loader.require("tabview", "treeview", "json","reset-fonts-grids");

                    loader.filter = 'debug';
                    loader.base = '../../build/';
                    loader.combine = false;

                    loader.onSuccess = function() {
                                log("insert callback");
                                YAHOO.util.Event.onAvailable("treediv", function() {
                                        log("onAvailable (treeview init)");
                                        var tree = new YAHOO.widget.TreeView("treediv");
                                        var n = new YAHOO.widget.TextNode("node 1", tree.getRoot());
                                        new YAHOO.widget.TextNode("node 2", n);
                                        new YAHOO.widget.TextNode("node 3", n);
                                        tree.draw();
                                    });


                                    YAHOO.util.Event.on(window, "load", function(e) {
                                        log("onload");
                                    });

                            };
                    loader.insert();

                    log(loader.sorted);


new YAHOO.util.YUILoader({
    combine: false,
    require: ['datatable'],
    onSuccess: function() {
        var loader = new YAHOO.util.YUILoader();
        loader.require("treeview");
        loader.combine = false;
        //loader.addModule(...);
        //loader.addModule(...);
        loader.insert();
    }
}).insert();



</script>


</head>
<body>

<script type="text/javascript">

</script>
<h1>header</h1>
<p>YAHOO is already on the page.  We will instantiate a YUILoader instance to load
additional components.  Note that because YAHOO is already on the page, we are not
able to take advantage of the automatic rollup capability (we load dom and event
individually instead of yahoo-dom-event).</p>
<div id="treediv"></div>
<div id="doc"></div>
</body>
</html>
